package com.hm.market.controllor;

import com.hm.market.domain.User;
import com.hm.market.service.AdminService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author HM
 * @create 2018/2/27 14:41
 * @desc
 **/
@RequestMapping
public class AdminController {

    @Autowired
    AdminService adminService;

    @RequestMapping(value = "adminLogin")
    public String adminLogin(HttpServletRequest request){
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        if(adminService.selectAdminByUsernameAndPwd(username,password)){
            return "index";
        }
        return "login";
    }

}
